/**
 * Miscellaneous shared functions go here.
 */


/**
 * Generate a random number of a certain length.
 */
export function getRandomInt(length: number): number {
  const num =  Math.floor(Math.random() * Math.pow(10, length));
  return +(num.toString().padStart(length, '0'))
}

/**
 * Wait for a certain number of milliseconds.
 */
export function tick(milliseconds: number): Promise<void> {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve();
    }, milliseconds);
  });
}
